package com.socodethis.spaceex;

import com.socodethis.spaceex.math.cPoint;

public abstract class attackClass{
	//This class should only be referenced through the attackHolder class
	private cPoint start, end, current,speed;
	float blastRadius,attackPattern;
	boolean finished;
	boolean rendered;
	attackClass(cPoint start, cPoint end, float speed, float radius, float attackPattern){
		/*Attack Patterns
		 * 1 - Normal
		 * 2 - Attack Scatters As It Approaches Enemies
		 * 3 - Attack Targets All Enemies
		 */
		this.start = new cPoint(start.getX(),start.getY());
		this.current = new cPoint(start.getX(),start.getY());
		this.end = new cPoint(end.getX(),end.getY());
		this.speed = new cPoint((this.end.getX()-this.current.getX())/speed, (this.end.getY()-this.current.getY())/speed);
		if(this.speed.cEquals(new cPoint(0,0))){
			this.speed.setPoint(0.1f, 0.1f);
		}
		finished = false;
		blastRadius = radius;
		this.attackPattern = attackPattern;
	}
	public cPoint getStart(){
		return start;
	}
	public cPoint getEnd(){
		return end;
	}
	public cPoint getSpeed(){
		return speed;
	}
	public void setSpeed(cPoint variance){
		speed.setPoint(variance.getX(), variance.getY());
	}
	public cPoint getCurrent(){
		return current;
	}
	public boolean getRendered(){
		return rendered;
	}
	public void setRendered(boolean value){
		rendered = value;
	}
	public float getAttackP(){
		return attackPattern;
	}
}
